import time


def puzir_sort(b):
    for i in range(len(b) - 1):
        for f in range(len(b) - 1):
            if b[f] > b[f + 1]:
                b[f], b[f + 1] = b[f + 1], b[f]


def readf1le(a):
    file = open(a)
    chisla = file.readlines()
    return chisla


m1 = readf1le("m1_sorted.txt")
m2 = readf1le("m2_reverse.txt")
m3 = readf1le("m3_shuffle.txt")

start_t = time.time()
puzir_sort(m1)
finish_t = time.time()
print("m1_sorted.txt", round((finish_t - start_t) * 1000), "milliseconds")

start_t = time.time()
puzir_sort(m2)
finish_t = time.time()
print("m1_sorted.txt", round((finish_t - start_t) * 1000), "milliseconds")

start_t = time.time()
puzir_sort(m3)
finish_t = time.time()
print("m1_sorted.txt", round((finish_t - start_t) * 1000), "milliseconds")